讓我們無痕開啟 http://localhost/phpmyadmin/ ,一招一式依樣畫葫蘆吧!
SELECT * FROM `profiles`
SELECT * FROM `profiles` WHERE `Addr` LIKE '台中%'
SELECT * FROM `profiles` WHERE `Addr` LIKE '台中_' AND `Old` >=18 AND `Old`<=20
SELECT * FROM `profiles` WHERE `Addr` LIKE '台中_' AND`Old` BETWEEN 18 AND 20
SELECT profiles.ID,profiles.Name,class.Hour
FROM `profiles`
LEFT JOIN `class`
ON profiles.ID = class.Name_ID
WHERE `Addr`LIKE '桃園%'
AND `Hour` BETWEEN 3 AND 6
INSERT INTO `profiles` (ID , Name , Old ,Addr )
VALUES ("","周杰倫","39","台北市")
-- 資料表有的縣市
UPDATE `profiles` SET `Addr` = '桃園市'
WHERE `Addr` = '桃園縣';
UPDATE `profiles` SET `Addr` = '台中市'
WHERE `Addr`= '台中縣';
UPDATE `profiles` SET `Addr` = '新北市'
WHERE `Addr`= '台北縣';
DELETE FROM `profiles`
WHERE `Name` = "周杰倫"
總結:
不要重複造輪子(Reinventing the wheel)
無劍勝有劍,武俠世界最高境界。
但我們重造輪子、拿起劍,是為了學習與練功,希望今天各位客官們玩得愉快,我們明天再會。